// license-header java merge-point
/**
 * This is only generated once! It will never be overwritten.
 * You can (and have to!) safely modify it by hand.
 */
package org.tinaelle.server.domain;
/**
 * @see org.tinaelle.server.domain.AdClient
 */
public class AdClientDaoImpl
    extends org.tinaelle.server.domain.AdClientDaoBase
{
    /**
     * @see org.tinaelle.server.domain.AdClientDao#toAdClientDTO(org.tinaelle.server.domain.AdClient)
     */
    public org.tinaelle.common.dto.AdClientDTO toAdClientDTO(final org.tinaelle.server.domain.AdClient entity)
    {
        return super.toAdClientDTO(entity);
    }

    /**
     * Retrieves the entity object that is associated with the specified value object
     * from the object store. If no such entity object exists in the object store,
     * a new, blank entity is created
     */
    private org.tinaelle.server.domain.AdClient loadAdClientFromAdClientDTO(org.tinaelle.common.dto.AdClientDTO adClientDTO)
    {
        org.tinaelle.server.domain.AdClient adClient = this.load(adClientDTO.getAdClientId());
        if (adClient == null)
        {
            adClient = org.tinaelle.server.domain.AdClient.Factory.newInstance();
        }
        return adClient;
    }

    
    /**
     * @see org.tinaelle.server.domain.AdClientDao#adClientDTOToEntity(org.tinaelle.common.dto.AdClientDTO)
     */
    public org.tinaelle.server.domain.AdClient adClientDTOToEntity(org.tinaelle.common.dto.AdClientDTO adClientDTO)
    {
        org.tinaelle.server.domain.AdClient entity = this.loadAdClientFromAdClientDTO(adClientDTO);
        this.adClientDTOToEntity(adClientDTO, entity, true);
        return entity;
    }
}